trigger: none

schedules:
- cron: "0 10 * * 6,0"
  displayName: Sat and Sun at 2:00 AM (UTC-8:00)
  branches:
    include:
    - main
  always: true

variables:
  - template: /eng/pipelines/common/variables.yml

extends:
  template:  /eng/pipelines/common/templates/pipeline-with-resources.yml
  parameters:
    stages:
    - stage: Build
      jobs:
      - template: /eng/pipelines/common/platform-matrix.yml
        parameters:
          jobTemplate: /eng/pipelines/common/global-build-job.yml
          buildConfig: checked
          platforms:
          - windows_x64
          - windows_x86
          jobParameters:
            buildArgs: -s clr.alljits+clr.spmi -c $(_BuildConfig)
            postBuildSteps:
              - template: /eng/pipelines/common/upload-artifact-step.yml
                parameters:
                  rootFolder: $(Build.SourcesDirectory)/artifacts/bin/coreclr
                  includeRootFolder: false
                  archiveType: $(archiveType)
                  tarCompression: $(tarCompression)
                  archiveExtension: $(archiveExtension)
                  artifactName: CheckedJIT_$(osGroup)$(osSubgroup)_$(archType)
                  displayName: JIT and SuperPMI Assets

      - template: /eng/pipelines/common/platform-matrix.yml
        parameters:
          jobTemplate: /eng/pipelines/common/global-build-job.yml
          buildConfig: release
          platforms:
          - windows_x64
          - windows_x86
          - linux_x64
          jobParameters:
            buildArgs: -s clr.alljits+clr.spmi -c $(_BuildConfig) /p:NoPgoOptimize=true
            postBuildSteps:
              - template: /eng/pipelines/common/upload-artifact-step.yml
                parameters:
                  rootFolder: $(Build.SourcesDirectory)/artifacts/bin/coreclr
                  includeRootFolder: false
                  archiveType: $(archiveType)
                  tarCompression: $(tarCompression)
                  archiveExtension: $(archiveExtension)
                  artifactName: ReleaseJIT_$(osGroup)$(osSubgroup)_$(archType)
                  displayName: JIT and SuperPMI Assets

      - template: /eng/pipelines/common/platform-matrix.yml
        parameters:
          jobTemplate: /eng/pipelines/coreclr/templates/superpmi-asmdiffs-checked-release-job.yml
          buildConfig: checked
          platforms:
          - windows_x64
          - windows_x86
          helixQueueGroup: ci
          helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
